package day7;

import day4.teacher.Teacher;

import java.beans.XMLDecoder;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class FromXMLToObj {
    public static void main(String[] args) {
        try {
            XMLDecoder xd=new XMLDecoder(new FileInputStream("teachers.xml"));
            List<Teacher> list = (List<Teacher>) xd.readObject();
            xd.close();
            for(Teacher t:list){
                System.out.println(t);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
